package com.dimples.dd.common.config;

import com.dimples.dd.common.spring.SpringContextHolder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * SpringContextHolder注册
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2024/9/14
 */
@Configuration
public class CommonConfig {

    /**
     * Spring上下文工具配置
     *
     * @return SpringContextHolder
     */
    @Bean
    @ConditionalOnMissingBean(SpringContextHolder.class)
    public SpringContextHolder springContextHolder() {
        return new SpringContextHolder();
    }
}
